import * as cc from 'cc';
import { SpriteFlipper } from './SpriteFlipper';
const { ccclass } = cc._decorator;
@ccclass('HelloWorld')
export class HelloWorld extends cc.Component {
    XFlipper: SpriteFlipper = null;
    YFlipper: SpriteFlipper = null;
    angle: number = 0;
    start() {
        cc.profiler.hideStats();
        this.XFlipper = this.node.getChildByName('XFlipper').getComponent(SpriteFlipper);
        this.YFlipper = this.node.getChildByName('YFlipper').getComponent(SpriteFlipper);
    }

    update() {
        ++this.angle;
        this.XFlipper.angle = cc.v2(this.angle, this.XFlipper.angle.y);
        this.YFlipper.angle = cc.v2(this.YFlipper.angle.x, this.angle);
    }
}